/*******************************************************************************
 * Copyright (c) 2011 Erik Byström.

 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
package se.slackers.automatunes.algorithm;

import java.util.Arrays;
import java.util.List;

import se.slackers.automatunes.ui.ParameterSet;

/**
 * @author Erik Byström
 * 
 */
public class BluesScale implements Scale {
	private final ParameterSet parameters = new ParameterSet();
	private final List<Integer> notes;

	public BluesScale() {
		notes = Arrays.asList(0, 3, 5, 6, 7, 10);
	}

	@Override
	public int translate(final int note) {
		if (notes.isEmpty()) {
			return note;
		}
		final int octave = (note / notes.size()) + 2;
		return octave * 12 + notes.get(note % notes.size());
	}

	@Override
	public ParameterSet parameters() {
		return parameters;
	}
}
